import { BaseService } from 'midwayjs-cool-core';


export class loeeBaseService extends BaseService {

  /**
   * 重写删除方法设置为逻辑删除
   */
  async delete(ids:any) {

    let idsArray: Array<number> 
    if (ids instanceof Array) {
      idsArray = ids
    }else{
      idsArray = ids.split(",")
    }
    for (let id of idsArray) {
      const Entity = await this.entity.findOne(id)
      Entity.isDelete = true
      this.entity.save(Entity)
    }
    await this.modifyAfter(ids,'delete');
  }
}